package biz.core.controller;

import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;


public class TestAli implements ServletRequestAware, ServletResponseAware{
	
	public String execute() throws Exception {
		String num=request.getParameter("success_num");
		String result_details=request.getParameter("result_details");
		String sign=request.getParameter("sign");
		System.err.println("num="+num);
		System.err.println(sign);
		System.err.println("detail="+result_details);
		Map<String,String[]> map=request.getParameterMap();
		
		StringBuilder paramsBuilder=new StringBuilder();
		String private_key="eid5sv4wm2244xauucenrlht6gi29n9l";
		paramsBuilder.append("batch_no=").append(map.get("batch_no")[0]).append("&")
		.append("notify_id").append(map.get("notify_id")[0]).append("&")
		.append("notify_time").append(map.get("notify_time")[0]).append("&")
		.append("notify_type").append(map.get("notify_type")[0]).append("&")
		.append("result_details").append(map.get("result_details")[0]).append("&")
		.append("success_num").append(map.get("success_num")[0]);
		
		
		
		for (Map.Entry<String, String[]> entry: map.entrySet()) {
			if(entry!=null){
			System.err.println(entry.getKey()+"--"+entry.getValue()[0]);
			}
		}
		
		PrintWriter out= response.getWriter();
		out.print("success");
		
		return null;
	}

	private HttpServletRequest request;
    private HttpServletResponse response;

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

    public void setServletResponse(HttpServletResponse response) {
        this.response = response;
    }

}
